<?php
/**
 * 
 * @author Youssef Driouach
 *
 */
class Application_Model_Request
{
	protected $_requestId;
	protected $_keyword;
	protected $_class;
	protected $_offerClass;
	protected $_optionss;
	protected $_admin_area_lvl1;
	protected $_admin_area_lvl2;
	protected $_country;
	protected $_price_interval;
	protected $_user;
	protected $_date;
	
	public function __construct(array $options = null)
	{
		if (is_array($options)) {
			$this->setOptions($options);
		}
	}
	
	public function __set($name, $value)
	{
		$method = 'set' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid request property');
		}
		$this->$method($value);
	}
	
	public function __get($name)
	{
		$method = 'get' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid request property');
		}
		return $this->$method();
	}
	
	public function setOptions(array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value) {
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods)) {
				$this->$method($value);
			}
		}
		return $this;
	}
	/**
	 * @return the $_requestId
	 */
	public function getRequestId() {
		return $this->_requestId;
	}

	/**
	 * @return the $_keyword
	 */
	public function getKeyword() {
		return $this->_keyword;
	}

	/**
	 * @return the $_class
	 */
	public function getClass() {
		return $this->_class;
	}

	/**
	 * @return the $_optionss
	 */
	public function getOptionss() {
		return $this->_optionss;
	}


	/**
	 * @return the $_price_interval
	 */
	public function getPrice_interval() {
		return $this->_price_interval;
	}

	/**
	 * @return the $_user
	 */
	public function getUser() {
		return $this->_user;
	}

	/**
	 * @param field_type $_requestId
	 */
	public function setRequestId($_requestId) {
		$this->_requestId = $_requestId;
	}

	/**
	 * @param field_type $_keyword
	 */
	public function setKeyword($_keyword) {
		$this->_keyword = $_keyword;
	}

	/**
	 * @param field_type $_class
	 */
	public function setClass($_class) {
		$this->_class = $_class;
	}
	
	/**
	 * @param field_type $_optionss
	 */
	public function setOptionss($_optionss) {
		$this->_optionss = $_optionss;
	}

	

	/**
	 * @param field_type $_price_interval
	 */
	public function setPrice_interval($_price_interval) {
		$this->_price_interval = $_price_interval;
	}

	/**
	 * @param field_type $_user
	 */
	public function setUser(Application_Model_User $_user) {
		$this->_user = $_user;
	}
	/**
	 * @return the $_date
	 */
	public function getDate() {
		return $this->_date;
	}

	/**
	 * @param field_type $_date
	 */
	public function setDate($_date) {
		$this->_date = $_date;
	}
	/**
	 * @return the $_admin_area_lvl1
	 */
	public function getAdmin_area_lvl1() {
		return $this->_admin_area_lvl1;
	}

	/**
	 * @return the $_admin_area_lvl2
	 */
	public function getAdmin_area_lvl2() {
		return $this->_admin_area_lvl2;
	}

	/**
	 * @return the $_offerClass
	 */
	public function getOfferClass() {
		return $this->_offerClass;
	}

	/**
	 * @param field_type $_offerClass
	 */
	public function setOfferClass($_offerClass) {
		$this->_offerClass = $_offerClass;
	}

	/**
	 * @return the $_country
	 */
	public function getCountry() {
		return $this->_country;
	}

	/**
	 * @param field_type $_admin_area_lvl1
	 */
	public function setAdmin_area_lvl1($_admin_area_lvl1) {
		$this->_admin_area_lvl1 = $_admin_area_lvl1;
	}

	/**
	 * @param field_type $_admin_area_lvl2
	 */
	public function setAdmin_area_lvl2($_admin_area_lvl2) {
		$this->_admin_area_lvl2 = $_admin_area_lvl2;
	}

	/**
	 * @param field_type $_country
	 */
	public function setCountry($_country) {
		$this->_country = $_country;
	}



}